#ifndef PRODUCEDATA_H
#define PRODUCEDATA_H

#include <QDialog>
#include <string>
#include <vector>

#include "datakeyboard.h"
#include "padgraphicsview.h"

namespace Ui {
class ProduceData;
}



class ProduceData : public QDialog
{
    Q_OBJECT

public:
    explicit ProduceData(QWidget *parent = nullptr);
    ~ProduceData();

protected:
    static const size_t max_text_len = 10000;
    char text[max_text_len];
    Ui::ProduceData *ui;
    std::vector<std::string> words;
    size_t wordNum, wordIndex, lastWordIndex, charIndex, totalChar, curChar;
    std::string underStr;
    PadGraphicsView *m_view;

    void initText();
    void showWords();
    void appendData(cv::Point2f point, char ch);
    void updateChar();

    DataKeyboard *dataKeyboard;
    FILE* outputFile;

public slots:
    virtual void receiveOneTap(float x, float y);
};

#endif // PRODUCEDATA_H
